package com.itheima.demo1;

public class exercise17 {
    public static void main(String[] args) {
        //求1~100之间的偶数和
        int sum = 0;
        for(int i = 1 ; i <= 100 ; i ++){
            //累加求和，先判断，再求和
            if(i % 2 == 0){
                sum = sum + i;
            }
        }
        System.out.println(sum);
    }
}
